/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.render;

import java.awt.Color;
import java.awt.Component;
import javax.swing.*;
import javax.swing.table.*;

/**
 *
 * @author Khaled Lela  
 */
public class MyCellRenderer extends JTextField implements TableCellRenderer {

    public MyCellRenderer() {
    }

    public Component getTableCellRendererComponent(JTable table, Object value,
            boolean isSelected, boolean hasFocus,
            int row, int column) {
        setFont(new java.awt.Font("Traditional Arabic", 0, 18));
        setHorizontalAlignment(JTextField.RIGHT);
        setText((String) value);
        if (isSelected == true) {
            setBackground(Color.CYAN);
        } else {
            setBackground(Color.WHITE);
        }
        return this;
    }
}
